#!/usr/bin/env pytho
# -*- coding: utf-8 -*-
import requests
import json
url = "http://172.16.1.188:8080/api/manage_member/user/auth/login" # 接口地址

payload = {
'password': '111111',
'username': 'chengyaunzigongsihao01',
'uuid': '',
'verifyCode': '',
}
r = requests.post(url, json=payload, verify=False)
# print(r.text)
token = json.loads(r.text)["token"] #获取登录后的token

urlcy ="http://172.16.1.21/xl-dcs/api/manage_member/user/member_user" #成员单位发布失信

data={
	"userId": "",
	"username": "chengyaunzizhanghao0008",   #*  账号
	"password": "111111",                 #* 密码
	"department": "成员单位子账号部门账号子账号部门字段",  #部门
	"departmentList": [],
	"jobId": ["17"],
	"name": "严钧三级子账号",  #*真实姓名
	"employeeId": "uniccc9000000006",        #*员工编号
	"jobName": "",
	"mobilePhone": "13451250116",       #*手机号
	"email": "13451250115hsysgabg26_0152455@sina.com",  #* 邮箱
	"macAdress": [],
	"userRemark": "成员单位子子账号体系五成员单位子子账号体系一成员单位子子账号体系一成员单位子子账号体系一成员单位子子账号体系一成员单位子子账号体系一成员单位子子账号体系一",
	"operationUser": "",
	"operationTime": "",
	"isDelete": "false"
}

data1=json.dumps(data)

headers = {"Accept"	:"application/json, text/plain, */*",
"Accept-Encoding"	:"gzip, deflate",
"Accept-Language"	:"zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
"Authorization"	: token,
"Connection"	:"keep-alive",
"Content-Length"	:"561",
"Content-Type"	:"application/json",
"Host"	:"172.16.1.21",
"Referer"	:"http://172.16.1.21/loginTo/homepage",
"User-Agent"	:"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36"}


r2 = requests.post(url=urlcy, data=data1, headers=headers)

print(r2.status_code)
print(r2.content)

print(data1)